import request from '@/utils/request'
// 查询汇总
export function getList(param) {
  return request({
    url: '/querySummary/manage.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

/* // 请求下拉
export function getSelect(param) {
  return request({
    url: '/querySummary/platformList.do',
    method: 'post',
    data: {
      param: param
    }
  })
} */

// 请求关联平台
export function getConnectPlat(param) {
  return request({
    url: '/group/associatedPlatform.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 取消关联
export function cancel(param) {
  return request({
    url: '/group/cancelAssociated.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 查询汇总积分
export function point(param) {
  return request({
    url: '/querySummary/userCreditManage.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 查询总积分
export function allPoint(param) {
  return request({
    url: '/querySummary/userCenterCreditSearch.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

/*
 ******************
 * author: 马丰彦
 * date: 2019-10-12
 * function: 新查询汇总
 ******************
 */

// 新列表
export function newList(param) {
  return request({
    url: '/querySummary/manage.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 新增保存
export function newSave(param) {
  return request({
    url: '/querySummary/save.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 编辑保存
export function newEdit(param) {
  return request({
    url: '/querySummary/update.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 用户详情
export function newDetail(param) {
  return request({
    url: '/group/userInfo.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 用户更改状态
export function newStatus(param) {
  return request({
    url: '/querySummary/userStatusChange.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 导入运营商用户接口
export function newOperator(param) {
  return request({
    url: '/querySummary/importOperatorUser.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 关联账号
export function newConnect(param) {
  return request({
    url: '/querySummary/associatedAccountList.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 关联账号取消关联
export function newCancelConnect(param) {
  return request({
    url: '/querySummary/associatedAccountList/unbind.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 校验ID是否存在
export function checkId(param) {
  return request({
    url: '/querySummary/checkUserId.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 下载
export function downLoad(param) {
  return request({
    url: '/ucbms/querySummary/download/template.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 上传exlce1
export function upload(data) {
  return request({
    url: '/querySummary/download/import.do',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'post',
    data
  })
}

// 上传excel2
export function upload1(data) {
  return request({
    url: '/querySummary/batchUpdate/import.do',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    method: 'post',
    data
  })
}

// 下拉框
export function newSelect(param) {
  return request({
    url: '/bcbs/virtualCoupon/functionTypeList.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 会员等级下拉框
// 下拉框
export function getVipSelect(param) {
  return request({
    url: '/tools/membershipLevelList.do',
    method: 'post',
    data: {
      param: param
    }
  })
}
// 业务平台
export function getSelect(param) {
  return request({
    url: '/tools/functionTypeList.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 饼图
export function getPie(param) {
  return request({
    url: '/summaryData/networkUsers.do',
    method: 'post',
    data: {
      param: param
    }
  })
}

// 折线一
export function getLine1(param) {
  return request({
    url: '/summaryData/userTrends.do',
    method: 'post',
    data: {
      param: param
    }
  })
}
// 折线二
export function getLine2(param) {
  return request({
    url: '/summaryData/powerOnUserTrends.do',
    method: 'post',
    data: {
      param: param
    }
  })
}
